home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_10
/
9n10024a
< prev
next >
Wrap
Text File
|
1991-08-12
|
837b
|
33 lines
/* --------------------------------------------------------------
FUNCTION DUMP_ASC_NODES: The steps to display all nodes in the list
in ascending order are:
A. Complain if list empty.
B. Traverse list starting at the root node displaying each node's
data.
-------------------------------------------------------------- */
void dump_asc_nodes(void)
{
Node *ptmp_node;
/*A*/ if (proot_node == NULL) {
printf("\n List contains no nodes\n");
return;
}
printf("\n List nodes are as follows:\n");
/*B*/ ptmp_node = proot_node;
while (ptmp_node != NULL) {
printf("\t%2u >%s<\n", ptmp_node->count,
ptmp_node->pstring);
ptmp_node = ptmp_node->pfwd;
}
}